﻿using System.Reflection;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace Kairos
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            Utilities.DbUpdate();

            Assembly assembly = Assembly.GetExecutingAssembly();

            Application["Title"] = assembly.GetCustomAttribute<AssemblyTitleAttribute>().Title;
            Application["Version"] = assembly.GetName().Version.ToString(2);
            Application["Copyright"] = assembly.GetCustomAttribute<AssemblyCopyrightAttribute>().Copyright;

            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            BinderConfig.RegisterBinders(ModelBinders.Binders);
        }
    }
}